﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;

namespace ShenLanCMS.Models
{
    /// <summary>
    /// 文章分类
    /// </summary>
    public class PostType
    {
        [Key]
        public int PostTypeID { get; set; }

        /// <summary>
        /// 分类名称
        /// </summary>
        [Display(Name = "分类名称")]
        [Required(ErrorMessage = "请填写{0}")]
        [StringLength(32, ErrorMessage = "分类名称不能超过{1}个字符")]
        public string TypeName { get; set; }

        /// <summary>
        /// 关键词
        /// </summary>
        [Display(Name = "关键词")]
        [StringLength(64, ErrorMessage = "关键词不能超过{1}个字符")]
        public string Keyword { get; set; }

        /// <summary>
        /// 分类简介
        /// </summary>
        [Display(Name = "分类简介")]
        [DataType(DataType.MultilineText)]
        [StringLength(128, ErrorMessage = "分类简介不能超过{1}个字符")]
        public string Description { get; set; }

        /// <summary>
        /// 父级id,0为根分类
        /// </summary>
        [Display(Name = "父级id")]
        public int ParentID { get; set; }

        /// <summary>
        /// 层
        /// </summary>
        [Display(Name = "层")]
        public int Layer { get; set; }

        /// <summary>
        /// 是否终极分类:终极分类才能增加文章
        /// </summary>
        [Display(Name = "是否终极分类")]
        public bool IsLast { get; set; }
    }
}
